package service.single;

import dao.SingleDAO;
import dao.RecordDuplicateException;
import entities.Single;


public class SingleServiceInMemory implements SingleService {

	public SingleServiceInMemory(){
		
	}
	
	public static SingleService newInstance(){
		return new SingleServiceInMemory();
	}
	
	/**
	 * Finds a customer based on the customer id.
	 * @param userid - user id
	 * @return the instance of the customer
	 */
	public Single findSingle(Long a_id){
		SingleDAO db = SingleDAO.getInstance();
		Single result = null;
		result = db.findSingle(a_id);
		return result;
	}
	
	
	/**
	 * Adds a new customer to the system.
	 * @param obj - the customer instance to add
	 */
	
	public void addSingle(Single obj) throws RecordDuplicateException{
		SingleDAO db = SingleDAO.getInstance();	
		db.addSingle(obj);
		return;
	}

}
